diff -u13 -r xorg-server-1.12.3-old/hw/xfree86/loader/loadmod.c xorg-server-1.12.3/hw/xfree86/loader/loadmod.c
--- xorg-server-1.12.3-old/hw/xfree86/loader/loadmod.c	2012-09-05 18:26:42.000000000 +0200
+++ xorg-server-1.12.3/hw/xfree86/loader/loadmod.c	2012-09-05 18:28:54.000000000 +0200
@@ -1109,39 +1109,38 @@
 static void
 RemoveChild(ModuleDescPtr child)
 {
     ModuleDescPtr mdp;
     ModuleDescPtr prevsib;
     ModuleDescPtr parent;
 
     if (!child->parent)
         return;
 
     parent = child->parent;
     if (parent->child == child) {
         parent->child = child->sib;
-        return;
-    }
-
-    prevsib = parent->child;
-    mdp = prevsib->sib;
-    while (mdp && mdp != child) {
-        prevsib = mdp;
-        mdp = mdp->sib;
+    }
+    else {
+        prevsib = parent->child;
+        mdp = prevsib->sib;
+        while (mdp && mdp != child) {
+            prevsib = mdp;
+            mdp = mdp->sib;
+        }
+        if (mdp == child)
+            prevsib->sib = child->sib;
     }
-    if (mdp == child)
-        prevsib->sib = child->sib;
     child->sib = NULL;
-    return;
 }
 
 void
 LoaderErrorMsg(const char *name, const char *modname, int errmaj, int errmin)
 {
     const char *msg;
     MessageType type = X_ERROR;
 
     switch (errmaj) {
     case LDR_NOERROR:
         msg = "no error";
         break;
     case LDR_NOMEM:
